package com.gdit.revenue.service.Impl;


import com.gdit.revenue.base.result.Results;
import com.gdit.revenue.dao.ExpenditureDao;
import com.gdit.revenue.model.Expenditure;
import com.gdit.revenue.service.ExpenditureService;
import com.gdit.revenue.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExpenditureServiceImpl implements ExpenditureService {
    @Autowired
    ExpenditureDao expenditureDao;


    @Override
    public Results getAllExpenditures(int offset, int limit) {
        //获取到记录对象的总行数
        int count = expenditureDao.count();
        return Results.success(count,expenditureDao.getAllExpenditures(offset,limit));
    }

    @Override
    public Results delete(int orderid) {
        return Results.success(expenditureDao.delete(orderid));
    }

    @Override
    public void addExpenditure(Expenditure expenditure) {
        expenditureDao.insert(expenditure);
    }

    @Override
    public Results updateExpenditure(Expenditure expenditure) {
        return null;
    }

}
